import ajax from './ajax'

export function searchEmployee(searchObj) {
  return ajax.get('/api/sys/apply/offers', { params: searchObj })
}

export function auditEmployee(auditObj) {
  let url = `/api/sys/apply/offer/${auditObj.applyId}`
  delete auditObj.applyId
  return ajax.put(url, auditObj)
}

// 获取业务员列表 [业务员申请]
export function getEmployeeList(searchObj) {
  return ajax.get('/api/sys/apply/offers', searchObj)
}

// 获取业务员列表 [业务员管理]
// searchObj {pageNum,limit,location,prodId}
export function getEmployeeListV2(searchObj) {
  let url = `/api/sys/service/employees`
  return ajax.get(url, { params: searchObj })
}
// 获取区域列表
export function getArea() {
  let url = `/api/area`
  return ajax.get(url)
}
// 设置星标业务员
export function starEmployee(userId) {
  let url = `/api/sys/user/${userId}/star`
  return ajax.put(url)
}
// 撤销星标业务员
export function removeStarEmployee(userId) {
  let url = `/api/sys/user/${userId}/star`
  return ajax.delete(url)
}
